package homework2;

import java.nio.channels.UnsupportedAddressTypeException;

public class ShapeDemo {
    public static Shape getShape(String type) throws UnsupportedAddressTypeException {
        Shape shape = null;
        if (type.equalsIgnoreCase("圆形"))
            shape = new Circle();
        if (type.equalsIgnoreCase("三角形"))
            shape = new Triangle();
        if (type.equalsIgnoreCase("矩形"))
            shape = new Rectangle();
        return shape;
    }
}
